<script setup>
import {reactive, ref} from "vue"
// 定义响应式变量
const count = ref(0)
// 定义对象的响应式
const person = reactive({name:"zhangsan",age:19})

const addCount = () => count.value++
const addAge = () => person.age++
</script>

<template>
    <h2>count:{{count}}</h2>
    <h2>{{person.name}}的年龄是{{person.age}}</h2>
    <button @click="addCount">count加一</button>
    <button @click="addAge">age加一</button>
</template>

